package chapter01

object Test13_IF2 {
  def main(args: Array[String]): Unit = {
    //多分支语句 if...else if...else
    println("请输入你的年龄：")
    val age = scala.io.StdIn.readInt()
    if(age<=0){
      println("输入错误")
    } else if(age<=10){
      println("儿童")
    }else if(age<=20){
      println("少年")
    }else if(age<=30){
      println("青年")
    }else if(age<=40){
      println("中年")
    }else if(age<=50){
      println("中老年")
    }else if(age<=70){
      println("老年")
    }else{
      println("晚年")
    }
  }
}
